package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.TbProductWholeasalePriceMapper;
import com.ruoyi.order.domain.TbProductWholeasalePrice;
import com.ruoyi.order.service.ITbProductWholeasalePriceService;

/**
 * 商品批发价位Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-19
 */
@Service
public class TbProductWholeasalePriceServiceImpl implements ITbProductWholeasalePriceService 
{
    @Autowired
    private TbProductWholeasalePriceMapper tbProductWholeasalePriceMapper;

    /**
     * 查询商品批发价位
     * 
     * @param id 商品批发价位主键
     * @return 商品批发价位
     */
    @Override
    public TbProductWholeasalePrice selectTbProductWholeasalePriceById(Long id)
    {
        return tbProductWholeasalePriceMapper.selectTbProductWholeasalePriceById(id);
    }

    /**
     * 查询商品批发价位列表
     * 
     * @param tbProductWholeasalePrice 商品批发价位
     * @return 商品批发价位
     */
    @Override
    public List<TbProductWholeasalePrice> selectTbProductWholeasalePriceList(TbProductWholeasalePrice tbProductWholeasalePrice)
    {
        return tbProductWholeasalePriceMapper.selectTbProductWholeasalePriceList(tbProductWholeasalePrice);
    }

    /**
     * 新增商品批发价位
     * 
     * @param tbProductWholeasalePrice 商品批发价位
     * @return 结果
     */
    @Override
    public int insertTbProductWholeasalePrice(TbProductWholeasalePrice tbProductWholeasalePrice)
    {
        tbProductWholeasalePrice.setCreateTime(DateUtils.getNowDate());
        return tbProductWholeasalePriceMapper.insertTbProductWholeasalePrice(tbProductWholeasalePrice);
    }

    /**
     * 修改商品批发价位
     * 
     * @param tbProductWholeasalePrice 商品批发价位
     * @return 结果
     */
    @Override
    public int updateTbProductWholeasalePrice(TbProductWholeasalePrice tbProductWholeasalePrice)
    {
        return tbProductWholeasalePriceMapper.updateTbProductWholeasalePrice(tbProductWholeasalePrice);
    }

    /**
     * 批量删除商品批发价位
     * 
     * @param ids 需要删除的商品批发价位主键
     * @return 结果
     */
    @Override
    public int deleteTbProductWholeasalePriceByIds(Long[] ids)
    {
        return tbProductWholeasalePriceMapper.deleteTbProductWholeasalePriceByIds(ids);
    }

    /**
     * 删除商品批发价位信息
     * 
     * @param id 商品批发价位主键
     * @return 结果
     */
    @Override
    public int deleteTbProductWholeasalePriceById(Long id)
    {
        return tbProductWholeasalePriceMapper.deleteTbProductWholeasalePriceById(id);
    }
}
